//package cur.nature.starter.common.config;
//
//import com.xfvape.uid.impl.CachedUidGenerator;
//import com.xfvape.uid.worker.DisposableWorkerIdAssigner;
//import com.xfvape.uid.worker.WorkerIdAssigner;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//@MapperScan(basePackages = "mybatis.base")
////https://zhuanlan.zhihu.com/p/709018850
//public class UidGeneratorConfig {
//
//    @Bean
//    public CachedUidGenerator cachedUidGenerator(WorkerIdAssigner disposableWorkerIdAssigner) {
//        CachedUidGenerator cachedUidGenerator = new CachedUidGenerator();
//        cachedUidGenerator.setWorkerIdAssigner(disposableWorkerIdAssigner);
//        // 时间戳位数
//        cachedUidGenerator.setTimeBits(29);
//        // 机器位数
//        cachedUidGenerator.setWorkerBits(21);
//        // 每毫秒生成序号位数
//        cachedUidGenerator.setSeqBits(13);
//        //从初始化时间起起， 可以使用8.7年
//        cachedUidGenerator.setEpochStr("2024-02-05");
//        return cachedUidGenerator;
//    }
//
//
//    @Bean
//    public DisposableWorkerIdAssigner disposableWorkerIdAssigner() {
//        DisposableWorkerIdAssigner disposableWorkerIdAssigner = new DisposableWorkerIdAssigner();
//        return disposableWorkerIdAssigner;
//    }
//
//}
